<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>初见VUE</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="app">
    <table>
      <thead>
        <td>id</td>
        <td>名字</td>
        <td>年龄</td>
      </thead>
      <tbody>
        <tr v-for="(item,index) in resData" :key="index">
          <td>{{item.id}}</td>
          <td>{{item.name}}</td>
          <td>{{item.age}}</td>
          <td>{{index}}</td>
        </tr>
      </tbody>
    </table>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        resData: [
          { id: 1, name: '张三', age: 12},
          { id: 2, name: '李四', age: 15},
          { id: 3, name: '王五', age: 20},
        ]
      },
      methods: {
        clickHandler() {
          this.msg = "改变vue"
        }
      }
    })
  </script>
</body>
</html>